package com.qingke.easyjava.jdbc.conn;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Arrays;

public class Jdbc6   extends  Jdbcconn{

	public static void main(String[] args) {
		
		Connection conn = null;
		PreparedStatement  ps = null;
		
		try {
			conn = getConnection();
			ps = conn.prepareStatement("insert into qingke.user(username,password) values(?,?)");
			
			for(int i = 1; i<=28; i++){
				ps.setString(1, "Qingke"+i);
				ps.setString(2, "123");
				
				ps.addBatch();
				
				int[] result = ps.executeBatch();
				System.out.println("result = "+Arrays.toString(result));
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
